/**
 *
 */
package com.kgcx.coupon.service;

import javax.annotation.Resource;

import com.kgcx.coupon.query.UserCouponQuery;
import com.kgcx.coupon.vo.coupon.UserCouponRespVO;
import com.kgcx.coupon.vo.coupon.UserCouponVO;
import org.springframework.stereotype.Service;

import com.kgcx.coupon.domain.UserCoupon;
import com.kgcx.coupon.mapper.UserCouponMapper;

import java.util.List;

/**
 * @author qinze
 *
 */
@Service
public class UserCouponService {

	@Resource
	private UserCouponMapper userCouponMapper;

	public void insertUserCoupon (UserCoupon userCoupon) {
		userCouponMapper.insert(userCoupon);
	}

	/**
	 * 批量插入
	 * @param list
	 */
	public void insertByBatch(List<UserCoupon> list){
		userCouponMapper.insertByBatch(list);
	}

	public List<UserCouponVO> selectUserCouponList(UserCouponQuery query){

		return  userCouponMapper.selectUserCouponList(query.getPlanCode());

	}

	public UserCouponRespVO selectUserCouponById(Long kid){
		return userCouponMapper.selectUserCouponById(kid);
	}

}
